package com.cvpoc.dto;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

public class ExperienceDTO implements Serializable {

	private static final long serialVersionUID = -7709922306672211757L;
	private int id;
	private int id_collaborateur;
	private Date dateDebut;
	private Date dateFin;
    private String employeur;
    private String client;
    private String projet;
    private String nopCode;
    private String description;
    private String environnement;
    private String mission;
    private String role;
    private String resume;
    private String domaine;
    private Set<ExperienceCompetenceDTO> experienceCompetences;

	public ExperienceDTO(Date dateDebut,
			Date dateFin, String employeur, String client, String projet,
			String nopCode, String description, String environnement,
			String mission, String role, String resume, String domaine) {
		this.dateDebut = dateDebut;
		this.dateFin = dateFin;
		this.employeur = employeur;
		this.client = client;
		this.projet = projet;
		this.nopCode = nopCode;
		this.description = description;
		this.environnement = environnement;
		this.mission = mission;
		this.role = role;
		this.resume = resume;
		this.domaine = domaine;
	}

	public ExperienceDTO() {
		super();
	}
	
	public Set<ExperienceCompetenceDTO> getExperienceCompetences() {
		return experienceCompetences;
	}

	public void setExperienceCompetences(
			Set<ExperienceCompetenceDTO> experienceCompetences) {
		this.experienceCompetences = experienceCompetences;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public int getId_collaborateur() {
		return id_collaborateur;
	}

	public void setId_collaborateur(int id_collaborateur) {
		this.id_collaborateur = id_collaborateur;
	}

	public Date getDateDebut() {
		return dateDebut;
	}

	public void setDateDebut(Date dateDebut) {
		this.dateDebut = dateDebut;
	}

	public Date getDateFin() {
		return dateFin;
	}

	public void setDateFin(Date dateFin) {
		this.dateFin = dateFin;
	}

	public String getEmployeur() {
		return employeur;
	}

	public void setEmployeur(String employeur) {
		this.employeur = employeur;
	}

	public String getClient() {
		return client;
	}

	public void setClient(String client) {
		this.client = client;
	}

	public String getProjet() {
		return projet;
	}

	public void setProjet(String projet) {
		this.projet = projet;
	}

	public String getNopCode() {
		return nopCode;
	}

	public void setNopCode(String nopCode) {
		this.nopCode = nopCode;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getEnvironnement() {
		return environnement;
	}

	public void setEnvironnement(String environnement) {
		this.environnement = environnement;
	}

	public String getMission() {
		return mission;
	}

	public void setMission(String mission) {
		this.mission = mission;
	}

	public String getRole() {
		return role;
	}

	public void setRole(String role) {
		this.role = role;
	}

	public String getResume() {
		return resume;
	}

	public void setResume(String resume) {
		this.resume = resume;
	}

	public String getDomaine() {
		return domaine;
	}

	public void setDomaine(String domaine) {
		this.domaine = domaine;
	}

	@Override
	public String toString() {
		return "Experience [id=" + id + ", id_collaborateur="
				+ id_collaborateur + ", dateDebut=" + dateDebut + ", dateFin="
				+ dateFin + ", employeur=" + employeur + ", client=" + client
				+ ", projet=" + projet + ", nopCode=" + nopCode
				+ ", description=" + description + ", environnement="
				+ environnement + ", mission=" + mission + ", role=" + role
				+ ", resume=" + resume + ", domaine=" + domaine + "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((client == null) ? 0 : client.hashCode());
		result = prime * result
				+ ((dateDebut == null) ? 0 : dateDebut.hashCode());
		result = prime * result + ((dateFin == null) ? 0 : dateFin.hashCode());
		result = prime * result
				+ ((description == null) ? 0 : description.hashCode());
		result = prime * result + ((domaine == null) ? 0 : domaine.hashCode());
		result = prime * result
				+ ((employeur == null) ? 0 : employeur.hashCode());
		result = prime * result
				+ ((environnement == null) ? 0 : environnement.hashCode());
		result = prime * result + id;
		result = prime * result + id_collaborateur;
		result = prime * result + ((mission == null) ? 0 : mission.hashCode());
		result = prime * result + ((nopCode == null) ? 0 : nopCode.hashCode());
		result = prime * result + ((projet == null) ? 0 : projet.hashCode());
		result = prime * result + ((resume == null) ? 0 : resume.hashCode());
		result = prime * result + ((role == null) ? 0 : role.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ExperienceDTO other = (ExperienceDTO) obj;
		if (client == null) {
			if (other.client != null)
				return false;
		} else if (!client.equals(other.client))
			return false;
		if (dateDebut == null) {
			if (other.dateDebut != null)
				return false;
		} else if (!dateDebut.equals(other.dateDebut))
			return false;
		if (dateFin == null) {
			if (other.dateFin != null)
				return false;
		} else if (!dateFin.equals(other.dateFin))
			return false;
		if (description == null) {
			if (other.description != null)
				return false;
		} else if (!description.equals(other.description))
			return false;
		if (domaine == null) {
			if (other.domaine != null)
				return false;
		} else if (!domaine.equals(other.domaine))
			return false;
		if (employeur == null) {
			if (other.employeur != null)
				return false;
		} else if (!employeur.equals(other.employeur))
			return false;
		if (environnement == null) {
			if (other.environnement != null)
				return false;
		} else if (!environnement.equals(other.environnement))
			return false;
		if (id != other.id)
			return false;
		if (id_collaborateur != other.id_collaborateur)
			return false;
		if (mission == null) {
			if (other.mission != null)
				return false;
		} else if (!mission.equals(other.mission))
			return false;
		if (nopCode == null) {
			if (other.nopCode != null)
				return false;
		} else if (!nopCode.equals(other.nopCode))
			return false;
		if (projet == null) {
			if (other.projet != null)
				return false;
		} else if (!projet.equals(other.projet))
			return false;
		if (resume == null) {
			if (other.resume != null)
				return false;
		} else if (!resume.equals(other.resume))
			return false;
		if (role == null) {
			if (other.role != null)
				return false;
		} else if (!role.equals(other.role))
			return false;
		return true;
	}
    
}
